package cn.lx.security.authcenter.entity;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Map;

/**
 * @ClassName PortalUserDetails
 * @Description: //todo
 * @Author: 落雪
 * @CreateDate: 2025/7/14 23:21
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/7/14 23:21
 * @UpdateRemark:
 * @Version: 1.0
 */
public class PortalUserDetails implements UserDetails {
    private static final long serialVersionUID = -1648434918682803219L;
    private String opterNo;
    private String userAcct;
    private String uactID;
    private String name;
    private String orgUntID;
    private String orgName;
    private String orgCodg;
    private String poolAreaCodg;
    private String deptID;
    private String deptName;
    private String admDvs;
    private String prntOrgID;
    private Map<String, String> insuTypePoolAreaMap;

    public PortalUserDetails() {
    }

    public Map<String, String> getInsuTypePoolAreaMap() {
        return this.insuTypePoolAreaMap;
    }

    public String getOpterNo() {
        return this.opterNo;
    }

    public void setOpterNo(String opterNo) {
        this.opterNo = opterNo;
    }

    public void setInsuTypePoolAreaMap(Map<String, String> insuTypePoolAreaMap) {
        this.insuTypePoolAreaMap = insuTypePoolAreaMap;
    }

    public String getUserAcct() {
        return this.userAcct;
    }

    public void setUserAcct(String userAcct) {
        this.userAcct = userAcct;
    }

    public String getUactID() {
        return this.uactID;
    }

    public void setUactID(String uactID) {
        this.uactID = uactID;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOrgUntID() {
        return this.orgUntID;
    }

    public void setOrgUntID(String orgUntID) {
        this.orgUntID = orgUntID;
    }

    public String getOrgName() {
        return this.orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getOrgCodg() {
        return this.orgCodg;
    }

    public void setOrgCodg(String orgCodg) {
        this.orgCodg = orgCodg;
    }

    public String getPoolAreaCodg() {
        return this.poolAreaCodg;
    }

    public void setPoolAreaCodg(String poolAreaCodg) {
        this.poolAreaCodg = poolAreaCodg;
    }

    public String getAdmDvs() {
        return this.admDvs;
    }

    public void setAdmDvs(String admDvs) {
        this.admDvs = admDvs;
    }

    public String getPrntOrgID() {
        return this.prntOrgID;
    }

    public void setPrntOrgID(String prntOrgID) {
        this.prntOrgID = prntOrgID;
    }

    public Collection<? extends GrantedAuthority> getAuthorities() {
        return AuthorityUtils.createAuthorityList(new String[]{"ROLE_PORTAL_USER"});
    }
    @Override
    public String getPassword() {
        return null;
    }
    @Override
    public String getUsername() {
        return this.getName();
    }
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
    @Override
    public boolean isEnabled() {
        return true;
    }

    public String getDeptID() {
        return this.deptID;
    }

    public void setDeptID(String deptID) {
        this.deptID = deptID;
    }

    public String getDeptName() {
        return this.deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
}
